package com.yunhe.policyfulfillment.policyful.repository;
import com.yunhe.policyfulfillment.authority.model.LoginUserApplyMatterQueryCondition;
import com.yunhe.policyfulfillment.policyful.domain.PolicyInfoApplyMatter;
import com.yunhe.policyfulfillment.policyful.model.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;

/**
 * @description 政策兑现企业在线申请/审批事项
 * @author hetao
 * @date 2021-08-24
 */
@Repository
public interface PolicyInfoApplyMatterRepository {

    /**
     * 新增
     * @author hetao
     * @date 2021/08/24
     **/
    int createPolicyInfoApplyMatter(PolicyInfoApplyMatter policyInfoApplyMatter);

    /**
     * 新增
     * @author hetao
     * @date 2021/08/24
     **/
    int createPolicyInfoApplyMatterSelective(PolicyInfoApplyMatter policyInfoApplyMatter);

    /**
     * 刪除
     * @author hetao
     * @date 2021/08/24
     **/
    int deletePolicyInfoApplyMatterByPrimaryKey(@Param("id") int id);

    /**
     * 更新
     * @author hetao
     * @date 2021/08/24
     **/
    int updatePolicyInfoApplyMatterByPrimaryKey(PolicyInfoApplyMatter policyInfoApplyMatter);

    /**
     * 更新
     * @author hetao
     * @date 2021/08/24
     **/
    int updatePolicyInfoApplyMatterByPrimaryKeySelective(PolicyInfoApplyMatter policyInfoApplyMatter);

    /**
     * 根据主键查询
     * @author hetao
     * @date 2021/08/24
     **/
    PolicyInfoApplyMatter searchPolicyInfoApplyMatterByPrimaryKey(@Param("id") int id);


    /**
     * 根据条件查询
     * @param policyInfoApplyMatterQueryCondition
     * @return
     */
    List<PolicyInfoApplyMatterVo> findPolicyInfoApplyMatterByQueryCondition(PolicyInfoApplyMatterQueryCondition policyInfoApplyMatterQueryCondition);

    /**
     * 门户查询
     * @param portalApplyMatterQueryCondition
     * @return
     */
    List<PortalApplyMatterVo> getPolicyInfoApplyMatterByCondition(PortalApplyMatterQueryCondition portalApplyMatterQueryCondition);

    void updateApplyMatter(PolicyInfoApplyMatter policyInfoApplyMatter);

    List<PolicyInfoApplyMatter> searchPolicyInfoApplyMatterByApplyMatterId(@Param("applyMatterId") Long id);

    List<PolicyInfoApplyMatterVo> findPolicyInfoAllApplyMatterByQueryCondition(PolicyInfoApplyMatterQueryCondition policyInfoApplyMatterQueryCondition);

    List<PersonalApplyMatterVo> findLoginUserApplyMatterByCondition(LoginUserApplyMatterQueryCondition loginUserApplyMatterQueryCondition);

    void updateCurrentAuditStatus(@Param("id") Long id);

    Integer getWorkVolume(@Param("year") int year);

    Integer getAwardedEnterprisesCount(@Param("year") int year);

    /**
     * 查询审批分组
     * @param queryCondition
     * @return
     * @author 张翔宇
     * @date 2021年11月17日13点53分
     */
    List<PolicyInfoApplyMatterVo> findApprovalGroupInfo(PolicyInfoApplyMatterQueryCondition queryCondition);

    List<PolicyInfoApplyMatterVo> findPolicyInfoParkApplyMatterByQueryCondition(PolicyInfoApplyMatterQueryCondition policyInfoApplyMatterQueryCondition);

    /**
     * 查找审批历史
     * @param queryCondition
     * @return
     * @author 张翔宇
     * @date 2021年11月17日 13点52分
     */
    List<PolicyInfoApplyMatterVo> findApprovalHistory(PolicyInfoApplyMatterQueryCondition queryCondition);

    /**
     * 查询历史审批分组
     * @param queryCondition
     * @return
     */
    List<PolicyInfoApplyMatterVo> findApprovalHistoryGroupInfo(PolicyInfoApplyMatterQueryCondition queryCondition);
}